package DP;

import java.util.Arrays;

/**
 * @author dx
 * @version 1.0
 * @date 2022/5/15 15:59
 * @description: 力扣 1480 一维动态数组
 */
public class RuningSum {
}

class runingSum_Solution{
    public int[] runingSum(int[] nums){
        int len = nums.length;
        int []dp = new int[len+1];
        dp[0] = 0;
        for(int i = 1;i <=len;i++){
            dp[i] = dp[i-1]+nums[i-1];
        }
        return Arrays.copyOfRange(dp,1,len+1);
    }
}
